package com.gosophia.conference.action.notification;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.conferenceManagement.confPreparation.ws.ConfPreparationWebService;
import com.gosophia.oa.action.JudgeCurrentUndertaker;
import com.gosophia.taskManagement.dto.JobDTO;
import com.gosophia.taskManagement.ws.TaskManagementWebService;
import com.gosophia.userManagement.dto.UserAccountDTO;

/**
 * 反馈通知Action，此Action用于反馈页面【参加】【不参加】
 * @author nana
 * @since  2011-3-26
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Scope("prototype")
@Controller("FeedBackNotificationAction")
public class FeedBackNotificationAction extends BaseSupportAction{

	private static final long serialVersionUID = 224091604768714618L;

	private Long jobId;
	
	private Long userId;
	
	private String ifAttend;
	
	private String ifAttendString;
	
	@Autowired
	private ConfPreparationWebService confPreparationWebService;

	@Autowired
	private TaskManagementWebService taskManagementWebService;
	
	private UserAccountDTO userAccountDTO;
	
    private JobDTO jobDto;
	
	@Override
	public String _execute() throws Exception {
		String ifString = "否";
		JobDTO job = taskManagementWebService.findJobDetailByJobId(jobId);
		JobDTO jobMeet = taskManagementWebService.findJobByMissionIdAndJobType(job.getMissionDTO().getMissionId(), "会务准备");
		if("yes".equals(ifAttend)) {
			ifAttendString = "同意";
			ifString = "是";
		}else {
			ifAttendString = "不同意";
			ifString = "否";
		}
		
		confPreparationWebService.updateNotificationFeedbackList(jobMeet.getJobId(), userId, ifString);
		return SUCCESS;
	}

	
	public Long getJobId() {
		return jobId;
	}


	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}


	public Long getUserId() {
		return userId;
	}


	public void setUserId(Long userId) {
		this.userId = userId;
	}


	public void setIfAttend(String ifAttend) {
		this.ifAttend = ifAttend;
	}

	public String getIfAttend() {
		return ifAttend;
	}


	public UserAccountDTO getUserAccountDTO() {
		return userAccountDTO;
	}


	public void setUserAccountDTO(UserAccountDTO userAccountDTO) {
		this.userAccountDTO = userAccountDTO;
	}


	public JobDTO getJobDto() {
		return jobDto;
	}


	public void setJobDto(JobDTO jobDto) {
		this.jobDto = jobDto;
	}


	public String getIfAttendString() {
		return ifAttendString;
	}


	public void setIfAttendString(String ifAttendString) {
		this.ifAttendString = ifAttendString;
	}
	
	

}
